//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.eResearch.RuntimeServices
{
    using System.Workflow.Runtime.Hosting;
    using Microsoft.Research.eResearch.Ontology.Lookup;
    using System.Collections;

    /// <summary>
    /// Implementation for job execution service.
    /// </summary>
    public class JobExecutionService : WorkflowRuntimeService
    {
        /// <summary>
        /// Stores Type initializer marked parameters.
        /// </summary>
        private Hashtable paramsHash = new Hashtable();

        /// <summary>
        /// Stores the workflow OUTPUT Parameters.
        /// </summary>
        private Hashtable outputParamsHash = new Hashtable();

        /// <summary>
        /// Initializes a new instance of the <see cref="JobExecutionService"/> class.
        /// </summary>
        /// <param name="jobId">The job id.</param>
        /// <param name="workflowName">Name of the workflow.</param>
        public JobExecutionService(string jobId, string workflowName)
        {
            this.JobIdConcept = new ConceptValuePair("trident:JobId", jobId);
            this.WorkflowName = workflowName;
        }

        /// <summary>
        /// Gets or sets the job id concept.
        /// </summary>
        /// <value>The job id concept.</value>
        public ConceptValuePair JobIdConcept { get; private set; }

        /// <summary>
        /// Gets or sets the name of the workflow.
        /// </summary>
        /// <value>The name of the workflow.</value>
        public string WorkflowName { get; private set; }

        /// <summary>
        /// Gets the params hash.
        /// </summary>
        /// <value>The params hash.</value>
        public Hashtable ParamsHash
        {
            get
            {
                return this.paramsHash;
            }
        }

        /// <summary>
        /// Gets the workflow output params hash
        /// </summary>
        /// <value>The output params hash.</value>
        public Hashtable OutputParamsHash
        {
            get
            {
                return this.outputParamsHash;
            }
        }
    }
}
